package com.lkd.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.lkd.entity.VM;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface VmMapper extends BaseMapper<VM>{
    /**
    * @Description 根据innerCode查询
    * @Param [id]
    * @Date 2025/8/17 21:29
    **/
    List<VM> getByInnerCodeId(String id);

    /**
     * @return
     * @Description 新增
     * @Param [vm]
     * @Date 2025/8/17 21:29
     */
    int insertVm(VM vm);

    /**
     * @return
     * @Description 修改
     * @Param [vm]
     * @Date 2025/8/17 21:29
     */
    boolean updateVm(String id, String nodeId);

    /**
     * @return
     * @Description 获取vm状态
     * @Param [id]
     * @Date 2025/8/17 21:29
     */
    @Select("select status from tb_vm_status where id = #{id}")
    String getStatusByVmId(Integer id);

}
